<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no, email=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>

</head>
<body>

<script>

    function Person(name, age, sex, friend) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.friend = friend;
        this.speak = function () {
            console.log("我是"+this.name+",今年"+this.sex+",性别"+this.sex+",我有"+this.friend)
        }


    }

    var obj = new Person("小明",18,"男","男朋友")
    obj.speak()


</script>


</body>
</html>